#include <stdio.h>
#include <math.h>

int main()
{
	double x = 1;
	double L = 0, H = x;//上下限
	double y = (L + H) / 2; //save the result
	while (fabs(y * y - x) > 0.0000001)
	{
		y = (L + H) / 2;
		if (y * y > x)
		{
			H = y;
		}
		else
		{
			L = y;
		}
	}
	printf("%f", y);

	return y;

}

